import request from "@/utils/request";

export const getCateList = ({ id, sel }) => {
  return request({
    method: "get",
    url: `categories/${id}/attributes`,
    params: {
      sel,
    },
  });
};

export const addParams = ({ id, attr_name, attr_sel }) => {
  return request({
    method: "post",
    url: `categories/${id}/attributes`,
    data: {
      attr_name,
      attr_sel,
    },
  });
};
// 根据 ID 查询参数
export const getQueryId = (id,cateId,attr_sel) => {
  return request({
    method:'get',
    url:`categories/${id}/attributes/${cateId}`,
    params: {
      attr_sel
    }
  })
}

// 编辑提交参数
export const editParams = (id,cateId,data) => {
  return request({
    method:'put',
    url:`categories/${id}/attributes/${cateId}`,
    data
  })
}

// 删除
export const deleteParams = (id,cateId) => {
  return request({
    method:'delete',
    url:`categories/${id}/attributes/${cateId}`
  })
}

// 编辑提交参数
// export const editParams = () => {
//   return request({
//     method:'put',

//   })
// }